package com.vhall.component.entity.account;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * @author dongsong
 */
@Data
@TableName("account")
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "AccountEntity对象", description = "用户表")
public class AccountEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "account_id", type = IdType.AUTO)
    @JsonProperty(value = "account_id")
    private Integer accountId;

    @TableField("phone")
    private Long phone;

    @TableField("username")
    private String username;

    @TableField("nickname")
    private String nickname;

    @TableField("sex")
    private Integer sex;

    @TableField("token")
    private String token;
    /**
     * 状态:-1|封停,0|正常
     */
    @TableField("status")
    private Integer status = 0;

    @JsonProperty(value = "profile_photo")
    @TableField("profile_photo")
    private String profilePhoto;

    /**
     * 1发起端  2观看端  3 游客
     */
    @JsonProperty(value = "account_type")
    @TableField("account_type")
    private Integer accountType;

    @JsonProperty(value = "third_user_id")
    @TableField("third_user_id")
    private String thirdUserId;

    @JsonProperty(value = "updated_at")
    @TableField("updated_at")
    private LocalDateTime updatedAt;

    @JsonProperty(value = "created_at")
    @TableField("created_at")
    private LocalDateTime createdAt;

    @JsonProperty(value = "deleted_at")
    @TableField("deleted_at")
    private LocalDateTime deletedAt;

    /**
     * 0=未删除,1=删除
     */
    @JsonProperty(value = "is_deleted")
    @TableField("is_deleted")
    private Integer isDeleted;

    @TableField("role_id")
    private Integer roleId;

    @TableField("device_id")
    private String deviceId;
    /**
     * 所属组织架构 code
     */
    @TableField("org_code")
    private String orgCode;
    /**
     * 所属组织架构 名称
     */
    @TableField("org_name")
    private String orgName;
    /**
     * 客户号,客户绑定的资金账号
     */
    @TableField("custid")
    private String custid;

    /**
     * 登录成功后会话 ID 串 加密
     */
    @TableField("logintoken_encrypted")
    private String logintokenEncrypted;

    public AccountEntity() {
    }

    public AccountEntity(Long phone, String username, String nickname, String token, Integer accountType) {
        this.phone = phone;
        this.username = username;
        this.nickname = nickname;
        this.token = token;
        this.accountType = accountType;
    }
}